package cn.com.huzo.model.entities.hr;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 请假单实体类
 *
 * @author 吴旭
 */
public class LeaveApplicationEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 8851797339145485092L;
    private String LeaveApplicationId;          // 请假单标识
    private Long UserId;                        // 请假人ID
    private String UserName;                    // 请假人名
    private Date StartTime;                     // 请假开始时间
    private Date EndTime;                       // 请假结束时间
    private Integer LeaveApplicationTypeId;     // 请假类型ID
    private String LeaveApplicationTypeName;    // 请假类型名
    private String Reason;                      // 原因
    private Date RealityStartTime;              // 实际请假开始时间
    private Date RealityEndTime;                // 实际请假结束时间
    private Short Status;                       // 当前状态：0：申请 1：审核中 2：审核完成
    private String FlowNodeKey;                 // 当前流程运行的节点定义名
    private String TaskId;                      // 当前任务ID
    private Boolean Reapply;                    // 重新申请标记

    public String getLeaveApplicationId() {
        return LeaveApplicationId;
    }

    public void setLeaveApplicationId(String LeaveApplicationId) {
        this.LeaveApplicationId = LeaveApplicationId;
    }

    public Long getUserId() {
        return UserId;
    }

    public void setUserId(Long UserId) {
        this.UserId = UserId;
    }

    public String getUserName() {
        return UserName;
    }

    public void setUserName(String UserName) {
        this.UserName = UserName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getStartTime() {
        return StartTime;
    }

    public void setStartTime(Date StartTime) {
        this.StartTime = StartTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getEndTime() {
        return EndTime;
    }

    public void setEndTime(Date EndTime) {
        this.EndTime = EndTime;
    }

    public Integer getLeaveApplicationTypeId() {
        return LeaveApplicationTypeId;
    }

    public void setLeaveApplicationTypeId(Integer LeaveApplicationTypeId) {
        this.LeaveApplicationTypeId = LeaveApplicationTypeId;
    }

    public String getLeaveApplicationTypeName() {
        return LeaveApplicationTypeName;
    }

    public void setLeaveApplicationTypeName(String LeaveApplicationTypeName) {
        this.LeaveApplicationTypeName = LeaveApplicationTypeName;
    }

    public String getReason() {
        return Reason;
    }

    public void setReason(String Reason) {
        this.Reason = Reason;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getRealityStartTime() {
        return RealityStartTime;
    }

    public void setRealityStartTime(Date RealityStartTime) {
        this.RealityStartTime = RealityStartTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getRealityEndTime() {
        return RealityEndTime;
    }

    public void setRealityEndTime(Date RealityEndTime) {
        this.RealityEndTime = RealityEndTime;
    }

    public Short getStatus() {
        return Status;
    }

    public void setStatus(Short Status) {
        this.Status = Status;
    }

    public String getFlowNodeKey() {
        return FlowNodeKey;
    }

    public void setFlowNodeKey(String FlowNodeKey) {
        this.FlowNodeKey = FlowNodeKey;
    }

    public String getTaskId() {
        return TaskId;
    }

    public void setTaskId(String TaskId) {
        this.TaskId = TaskId;
    }

    public Boolean getReapply() {
        return Reapply;
    }

    public void setReapply(Boolean Reapply) {
        this.Reapply = Reapply;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof LeaveApplicationEntity)) {
            return false;
        }

        final LeaveApplicationEntity that = (LeaveApplicationEntity) o;

        return new EqualsBuilder()
                .append(this.getLeaveApplicationId(), that.getLeaveApplicationId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getLeaveApplicationId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
